package com.stylefeng.guns.rest.modular.controller;

import com.stylefeng.guns.common.dto.common.ResultData;
import com.stylefeng.guns.modular.system.service.ITimerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * user controller
 * Created by lyz on 2018/1/26.
 */

@RestController
@CrossOrigin
@RequestMapping(value = "/api/timer")
@Api(value = "定时器相关接口", produces = "application/json")
public class TimerController {

    @Autowired
    private ITimerService timerService;

    @PostMapping("/now")
    @ApiOperation(value = "查询服务器当前时间", notes = "返回服务器当前时间戳")
    public ResultData<Long> getNow() {
        return ResultData.createResult((new Date()).getTime());
    }
}
